#include <stdio.h>
#include <case4.h>
#include <iostream>
using namespace std;
BusData bus[] = {
    1, 3, 50, 30.99, 0, 0, 1, 1, 0, 230, 1, 1.1, 0.9,
    2, 1, 170, 105.35, 0, 0, 1, 1, 0, 230, 1, 1.1, 0.9,
    3, 1, 200, 123.94, 0, 0, 1, 1, 0, 230, 1, 1.1, 0.9,
    4, 2, 80, 49.58, 0, 0, 1, 1, 0, 230, 1, 1.1, 0.9};

GenData gen[] = {
4,318,0,100,-100,1.02,100,1,318,0,0,0,0,0,0,0,0,0,0,0,0,
1,0,0,100,-100,1,100,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
};

BranchData branch[] = {
1,2,0.01008,0.0504,0.1025,250,250,250,0,0,1,-360,360,
1,3,0.00744,0.0372,0.0775,250,250,250,0,0,1,-360,360,
2,4,0.00744,0.0372,0.0775,250,250,250,0,0,1,-360,360,
3,4,0.01272,0.0636,0.1275,250,250,250,0,0,1,-360,360,
};

//打印数据
void printData()
{
    cout << "baseMVA = " << baseMVA << endl;
    cout << "nBus = " << nBus << endl;
    cout << "nGen = " << nGen << endl;
    cout << "nBranch = " << nBranch << endl;
    cout << "BusData:" << endl;
    for (int i = 0; i < nBus; i++)
    {
        cout << bus[i].bus_i << " " << bus[i].type << " " << bus[i].Pd << " " << bus[i].Pq << " " << bus[i].Gs << " " << bus[i].Bs << " " << bus[i].area << " " << bus[i].Vm << " " << bus[i].Va << " " << bus[i].baseKV << " " << bus[i].zone << " " << bus[i].vMax << " " << bus[i].vMin << endl;
    }
    cout << "GenData:" << endl;
    for (int i = 0; i < nGen; i++)
    {
        cout << gen[i].bus_i << " " << gen[i].Pg << " " << gen[i].Qg << " " << gen[i].Qmax << " " << gen[i].Qmin << " " << gen[i].Vg << " " << gen[i].mBase << " " << gen[i].status << " " << gen[i].Pmax << " " << gen[i].Pmin << " " << gen[i].Pc1 << " " << gen[i].Pc2 << " " << gen[i].Qc1min << " " << gen[i].Qc1max << " " << gen[i].Qc2min << " " << gen[i].Qc2max << " " << gen[i].ramp_agc << " " << gen[i].ramp_10 << " " << gen[i].ramp_30 << " " << gen[i].ramp_q << " " << gen[i].apf << endl;
    }
    cout << "BranchData:" << endl;
    for (int i = 0; i < nBranch; i++)
    {
        cout << branch[i].fbus << " " << branch[i].tbus << " " << branch[i].r << " " << branch[i].x << " " << branch[i].b << " " << branch[i].rateA << " " << branch[i].rateB << " " << branch[i].rateC << " " << branch[i].ratio << " " << branch[i].angle << " " << branch[i].status << " " << branch[i].angmin << " " << branch[i].angmax << endl;
    }   
}

